Thermal : CPU temperature detection

更新时间:
2024-05-13
下载文档

Thermal : CPU temperature detection

This module is used to obtain the current operating temperature of the CPU.

User can use the following code to import the Thermal module.

var Thermal = require('thermal');

Support

The following shows Thermal module APIs available for each permissions.

 User ModePrivilege Mode
Thermal 
Thermal.exists 
thermal.close 
thermal.read 

Thermal Class

new Thermal()

  • Returns: {Object} A new thermal object.

Create a thermal object.

Thermal.exists()

  • Returns: {Boolean} Whether there is an thermal device.

Whether there is an thermal device, if there is no new operation will throw an exception.

Example

if (Thermal.exists()) {
  var thermal = new Thermal();
}

Thermal Object

thermal.close()

Close thermal object.

thermal.read([fa])

  • fa {Boolean} Whether to get Fahrenheit temperature. default: false.
  • Returns: {Number} CPU current temperature.

Get current CPU temperature.

Example

var thermal = new Thermal();
var celsius = thermal.read();
var fahrenheit = thermal.read(true);
文档内容是否对您有所帮助?
有帮助
没帮助